<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/9/3
  Time: 10:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%!
    //编写java代码中的方法
    String formartDate(Date date){
        //指定格式化日期的格式
        SimpleDateFormat simpleDateFormat=
                new SimpleDateFormat("现在时间是:yyyy:MM:dd:hh:mm:ss");
        return simpleDateFormat.format(date);
    }
%>
<%=formartDate(new Date())%>
</body>
</html>
